import request from '@/utils/request'

// 查询量表筛选列表
export function listScreen(query) {
  return request({
    url: '/dcp/screen/list',
    method: 'get',
    params: query
  })
}

// 查询量表筛选详细
export function getScreen(scaleScreenId) {
  return request({
    url: '/dcp/screen/' + scaleScreenId,
    method: 'get'
  })
}

// 新增量表筛选
export function addScreen(data) {
  return request({
    url: '/dcp/screen',
    method: 'post',
    data: data
  })
}
// 新增量表筛选
export function addAssign(data1,data2) {
  return request({
    url: '/dcp/screen/assign',
    method: 'post',
    data: {
      scaleId: data1,
      patientId: data2
    }
  })
}
// 修改量表筛选
export function updateScreen(data) {
  return request({
    url: '/dcp/screen',
    method: 'put',
    data: data
  })
}

// 删除量表筛选
export function delScreen(scaleScreenId) {
  return request({
    url: '/dcp/screen/' + scaleScreenId,
    method: 'delete'
  })
}

//新增
export function insterScreen(data) {
  return request({
    url: '/dcp/screen/add',
    method: 'post',
    data: data
  })
}

//上传图片
export function uploadPhoto(formData) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data', // 必须明确设置
    }
  })
}
